package com.blank.javawebexam;

import com.blank.javawebexam.pojo.Student;
import com.blank.javawebexam.service.StudentService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * @author BLANK
 * @date 2020/11/26
 */
public class test {
  static   private ApplicationContext ctx;
    public static void main(String[] args) {
        ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        StudentService studentService = (StudentService) ctx.getBean("studentService");
        List<Student> list= studentService.getList();
        for (Student student:list){
            System.out.println(student.getName());
        }

    }
}
